<div data-ng-controller="paramsBalancerateCtrl">
    <div class="mt20 clearfix ng-scope ml25">
        <span  class="fl lh30 f14 c-orange">结算比例设置</span>

        <div class="fr btn-group">
            <input type="text" class="fl input-text w200 ml3" placeholder="产品名称/区域" ng-model="keyword"
                   ng-enter="getBalanceRate()">
            <button class="btn" ng-click="getBalanceRate()">查询</button>
            <button type="button" class="btn btn-yellow" ng-click="newBalanceRate()">新增</button>
        </div>
    </div>

    <div id="grid" class="table-wrap mt10 ml25" style="min-height: 200px;">
        <table width="100%">
            <thead>
            <tr>
                <th width="24">序号</th>
                <th width="150">产品</th>
                <th width="150">区域</th>
                <th width="150">比例</th>
                <th width="100">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="record in params">
                <td class="lh40" style="height: 40px">
                    <p ng-bind="$index + 1"></p>
                </td>
                <td class="lh40" style="height: 40px">
                    <p  ng-if="record.editMode==0">{{record.appname}}</p>

                    <p ng-if="record.editMode!=0">
                        <input id="balance_rate_id" select2 ng-model="record.balance_rate_id" select2-model="ddl2ApplicationName"
                               config="ddlConfigApplicationName" class="form-control" placeholder="应用名称"/>
                    </p>
                </td>
                <td class="lh14">
                    <p  ng-if="record.editMode==0">{{record.BUName}}</p>

                    <p ng-if="record.editMode!=0">
                        <input id="BUGUID" select2 ng-model="record.BUGUID" select2-model="ddl2BUName"
                               config="ddlConfigBUName" class="form-control" placeholder="区域名称"/>
                    </p>
                </td>
                <td class="lh14">
                    <p  ng-if="record.editMode==0">{{record.rate}}</p>

                    <input type="number" name="rate" required class="form-control align-r"
                           ng-model="record.rate" min="0" ng-if="record.editMode!=0"
                           placeholder="比例">
                </td>
                <td class="lh14">
                    <a id="btnUpdate" ng-if="(record.editMode || 0)  == 0" href="javascript:void(0)"
                       title="修改信息"
                       ng-click="editBalanceRate(record,$index)">修改</a>
                    <a ng-if="(record.editMode || 0)  != 0" href="javascript:void(0)"
                       title="保存信息"
                       ng-click="saveBalanceRate(record,$index)">保存</a>
                    <a ng-if="(record.editMode || 0)  != 0" href="javascript:void(0)"
                       title="取消"
                       ng-click="cancelBalanceRate(record,$index)">取消</a>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

</div>